home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-04-20 | 477 b | 24 lines |
- import java.awt.*;
- import java.applet.*;
-
- public class MyButtonApplet extends Applet {
- public void init() {
- String s = getParameter("button");
-
- if (s == null)
- s = new String("giraffe");
-
- add(new MyButton(s));
- }
- }
-
- class MyButton extends Button {
- MyButton(String s) {
- super(s);
- }
- public boolean action(Event e, Object what) {
- System.out.println(getLabel());
- return super.action(e, what);
- }
- }
-